package com.yimils.core.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yimils.core.sys.entity.ResourceEntity;


import java.util.List;

public interface ResourceService extends IService<ResourceEntity> {

    ResourceEntity getParentById(Long id);
    List<ResourceEntity> getDirs();
    ResourceEntity getMidParent(ResourceEntity item);
    boolean create(ResourceEntity reqParams);
    boolean update(List<ResourceEntity> reqParams);
    boolean delete(Long id);
    List<ResourceEntity> getDirAll();//获取系统中所有目录 get type == 0
    List<ResourceEntity> getDirByRoleId(Long id);//获取系统指定角色的所有目录 get type == 0
    List<ResourceEntity> getMenuAll(Long dirId);//获取系统中指定目录所有菜单 get type == 1
    List<ResourceEntity> getMenuByRoleId(Long dirId, Long roleId);//获取系统中指定角色中指定目录的所有菜单 get type == 1
    List<ResourceEntity> getPermAll(Long menuId);//获取系统中指定菜单下所有权限 get type == 2
    List<ResourceEntity> getPermByRoleId(Long menuId, Long roleId);//获取系统中指定角色中指定目录下的菜单权限 get type == 2
    Integer TYPE_DIR = 0; //目录类型资源
    Integer TYPE_SUB = 1; //二级目录类型资源
    Integer TYPE_PERM = 2;//权限类型资源


}
